const {con} = require('../db/db');

async function searchForModels(text) {
    const sql = `select * from modelimg where mod_img_name like '%${text}%';`;

    let [rows] = await con.execute(sql);

    return rows;
}

async function searchForTextrues(text) {
    const sql = `select * from textrue where textrue_name like '%${text}%';`;

    let [rows] = await con.execute(sql);

    return rows;
}

async function searchForCourses(text) {
    const sql = `select * from course where title like '%${text}%';`;

    let [rows] = await con.execute(sql);

    return rows;
}

module.exports={
    searchForModels,
    searchForTextrues,
    searchForCourses
}